#!/bin/bash
{
gcFile=$(ls -tr /mnt/GC*.log |tail -n1)
check_jvm="$(tail -n50 ${gcFile} |grep -a '\->'|tail -n1)"
fullGC=$(echo ${check_jvm} | grep -c 'Full')
} 2>/dev/null
if [[ ${fullGC} != 1 ]]; then
# 由于返回的数值单位是KB，配置Zabbix模板时单位设置为B，乘数1024
	echo "${check_jvm}" |awk -F'[K(]' '{print $8}'
else
	echo "${check_jvm}" |awk -F'[K(]' '{print $12}'
fi
